package com.incar.chuxing.api;


import com.google.gson.JsonObject;
import com.incar.chuxing.bean.AbatementMoneyBean;
import com.incar.chuxing.bean.AddPreOrder;
import com.incar.chuxing.bean.AppConstants;
import com.incar.chuxing.bean.CancelOrder;
import com.incar.chuxing.bean.CarBleBean;
import com.incar.chuxing.bean.CarDamageBean;
import com.incar.chuxing.bean.CarDetailBean;
import com.incar.chuxing.bean.CarOrderDetailBean;
import com.incar.chuxing.bean.CheckCarOrderBean;
import com.incar.chuxing.bean.CheckPeccancyBean;
import com.incar.chuxing.bean.CheckPositionBean;
import com.incar.chuxing.bean.CityDetailBean;
import com.incar.chuxing.bean.CommitCardInforBean;
import com.incar.chuxing.bean.CommitDriveLicenseBean;
import com.incar.chuxing.bean.CommonResultBean;
import com.incar.chuxing.bean.CurrentFeeBean;
import com.incar.chuxing.bean.DayRentPriceBean;
import com.incar.chuxing.bean.DeliverPriceBean;
import com.incar.chuxing.bean.ExistingTravel;
import com.incar.chuxing.bean.ForbidArea;
import com.incar.chuxing.bean.InitBean;
import com.incar.chuxing.bean.InviteFriendsBean;
import com.incar.chuxing.bean.JudgeOrderBean;
import com.incar.chuxing.bean.LoginBean;
import com.incar.chuxing.bean.OpenedCityListBean;
import com.incar.chuxing.bean.OperateBean;
import com.incar.chuxing.bean.PersonalCardRemindBean;
import com.incar.chuxing.bean.PlaceOrderBean;
import com.incar.chuxing.bean.PopPostBean;
import com.incar.chuxing.bean.PostNewBean;
import com.incar.chuxing.bean.PreOrderDetailBean;
import com.incar.chuxing.bean.QualificationBean;
import com.incar.chuxing.bean.RechargeDotBean;
import com.incar.chuxing.bean.ResultBean;
import com.incar.chuxing.bean.ReturnCarBean;
import com.incar.chuxing.bean.ReturnCarCommentBean;
import com.incar.chuxing.bean.ReturnGoldTipBean;
import com.incar.chuxing.bean.SendTelBean;
import com.incar.chuxing.bean.SmsCodeBean;
import com.incar.chuxing.bean.TravelDetailBean;
import com.incar.chuxing.bean.TravelRecordBean;
import com.incar.chuxing.bean.UploadImageBaidu;
import com.incar.chuxing.bean.UserCarInforBean;
import com.incar.chuxing.bean.ZhiMaShouQuanBean;

import java.util.Map;

import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import retrofit2.http.Url;

public interface ApiService {

    //app config
    @GET("v1/config/android")
    Call<JsonObject> appConfig(@Query("version") String version, @Query("platform") String platform);

    //app Constants
    @GET("/v1/advert")
    Call<AppConstants> getAppConstants(@Query("version") String version, @Query("platform") String platform);


    //初始化
    @FormUrlEncoded
    @POST("incar/init/init-app.json")
    Call<InitBean> initApp(@FieldMap Map<String, String> map, @Field("style") String style);

    //开通城市的信息
    @FormUrlEncoded
    @POST("incar/city/getCityInfo/v2")
    Call<CityDetailBean> getCityInfo(@FieldMap Map<String, String> map);

    //弹出海报
    @GET("misc/v2/homepage")
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    Call<PostNewBean> getNewPost(@QueryMap Map<String, String> map, @Query("area_code") String area_code);

    //寻车弹出海报
    @FormUrlEncoded
    @POST("incar/promote/getPromoteByPopup")
    Call<PopPostBean> getPopPost(@FieldMap Map<String, String> map, @Field("entry") String entry);

    //发送短信
    @POST("user-login/login/send-message")
    Call<SmsCodeBean> sendSms(@Body RequestBody body);

    //登录
    @POST("user-login/login/mobile-login")
    Call<LoginBean> login(@Body RequestBody body);

    //资格状态查询
    @FormUrlEncoded
    @POST("incar/v/user/status")
    Call<QualificationBean> getUserStatus(@FieldMap Map<String, String> map);

    /**
     * 寻车
     */
    @FormUrlEncoded
    @POST("incar/v/car/call-car.json")
    Call<OperateBean> findCar(@FieldMap Map<String, String> map, @Field("orderId") String orderId, @Field("carId") String carId);

    /**
     * 网络开车门
     */
    @FormUrlEncoded
    @POST("incar/v/car/open-car-door.json")
    Call<OperateBean> openCar(@FieldMap Map<String, String> map, @Field("orderId") String orderId, @Field("carId") String carId, @Field("force") String force);


    @FormUrlEncoded
    @POST("incar/v/car/close-car-door.json")
    Call<OperateBean> lockCar(@FieldMap Map<String, String> map, @Field("orderId") String orderId, @Field("carId") String carId, @Field("force") String force);

    //还车
    @FormUrlEncoded
    @POST("incar/v/car/return-car.json")
    Call<ReturnCarBean> returnCar(@FieldMap Map<String, String> map, @Field("orderId") String orderId, @Field("carId") String carId, @Field("parkId") String parkId,
                                  @Field("userRemark") String userRemark, @Field("isBluetoothConnect") String isBluetoothConnect, @Field("remarkPic") String remarkPic,
                                  @Field("orderReasonId") String orderReasonId, @Field("logType") String logType, @Field("confirmRetu") String confirmRetu);

    //还车判断
    @FormUrlEncoded
    @POST("incar/v/car/confirm-return-car")
    Call<ReturnCarBean> intentReturnCar(@FieldMap Map<String, String> map, @Field("orderId") String orderId, @Field("carId") String carId, @Field("isReturn") String isReturn);


    //确认租用电车
    @FormUrlEncoded
    @POST("incar/v/order/add.json")
    Call<PlaceOrderBean> rentCar(@FieldMap Map<String, String> map, @Field("carId") String carId, @Field("isAbatement") String isAbatement, @Field("priceType") String priceType, @Field("rentType") String rentType, @Field("endCarTime") String endCarTime, @Field("dayNum") String dayNum);

    //行程列表
    @FormUrlEncoded
    @POST("incar/v/order/gain-list")
    Call<TravelRecordBean> getTravelRecord(@FieldMap Map<String, String> map, @Field("pageNo") String page, @Field("pageSize") String pageSize, @Field("orderBusinessType") String orderBusinessType);

    //取消订单
    @FormUrlEncoded
    @POST("incar/v/order/cancel.json")
    Call<CancelOrder> cancelOrder(@FieldMap Map<String, String> map, @Field("orderId") String orderId);

    //检查是否后台已经自动取消订单
    @FormUrlEncoded
    @POST("incar/v/order/check-auto-cancel")
    Call<CheckCarOrderBean> checkAutoCancel(@FieldMap Map<String, String> map, @Field("orderId") String orderId);

    //获取已存在的行程
    @FormUrlEncoded
    @POST("incar/v/order/get-unfinish")
    Call<ExistingTravel> getExistingTravel(@FieldMap Map<String, String> map);

    //行驶中获取订单详情
    @FormUrlEncoded
    @POST("incar/v/order/detail")
    Call<TravelDetailBean> getTravelDetail(@FieldMap Map<String, String> map, @Field("orderId") String orderId);


    //获取蓝牙信息
    @FormUrlEncoded
    @POST("incar/v/bluetooth/bluetoothInfo")
    Call<CarBleBean> getCarBleInfo(@FieldMap Map<String, String> map, @Field("carId") String carId);

    //获取上传图片的key和token
    @FormUrlEncoded
    @POST("incar/bce/getsts")
    Call<UploadImageBaidu> uploadImageBaidu(@FieldMap Map<String, String> map, @Field("command") String command, @Field("type") String type);

    //重复锁车
    @FormUrlEncoded
    @POST("incar/v/car/alone-close-car-door")
    Call<ResultBean> closeDoorAgain(@FieldMap Map<String, String> map, @Field("orderId") String orderId, @Field("carId") String carId);

    @FormUrlEncoded
    @POST("incar/share/share-invite.json")
    Call<InviteFriendsBean> inviteFriends(@FieldMap Map<String, String> map, @Field("type") String type);

    //汽车详情
    @FormUrlEncoded
    @POST("incar/v/order/order-detail.json")
    Call<CarOrderDetailBean> getTravelDetail(@FieldMap Map<String, String> map, @Field("orderId") String orderId, @Field("orderBusinessType") String orderBusinessType);


    /**
     * 是否在围栏外
     */
    @FormUrlEncoded
    @POST("incar/v/park/point-park-money")
    Call<CheckPositionBean> getCheckPosition(@FieldMap Map<String, String> map, @Field("orderId") String orderId, @Field("carId") String carId);

    /**
     * 认证通过
     */
    @FormUrlEncoded
    @POST("incar/v/user/identification")
    Call<UserCarInforBean> getUserCarInfo(@FieldMap Map<String, String> map);

    //提交身份证 驾驶证 自拍
    @FormUrlEncoded
    @POST("incar/v/user/upload-user-info")
    Call<CommitCardInforBean> confirmUserInfor(@FieldMap Map<String, String> map,
                                               @Field("userName") String userName,
                                               @Field("identityCardNum") String identityCardNum,
                                               @Field("identityPositivePicture") String identityPositivePicture,
                                               @Field("identityOppositePicture") String identityOppositePicture,
                                               @Field("selfie") String selfie,
                                               @Field("licensePicture") String licensePicture,
                                               @Field("licensePictureCopy") String licensePictureCopy,
                                               @Field("status") String ocrstatus,
                                               @Field("degree") String policeScore,
                                               @Field("identityPositiveInfoJsonStr") String identityPositiveInfoJsonStr,
                                               @Field("identityOppositeInfoJsonStr") String identityOppositeInfoJsonStr,
                                               @Field("licenseInfoJsonStr") String licenseInfoJsonStr);

    /**
     * 忘带证件提醒
     */
    @FormUrlEncoded
    @POST("incar/v/user/no-card-notify")
    Call<PersonalCardRemindBean> getCardRemind(@FieldMap Map<String, String> map, @Field("canNotifyTime") String canNotifyTime);


    /**
     * 当前费用
     */
    @FormUrlEncoded
    @POST("incar/v/account/currentFee")
    Call<CurrentFeeBean> getCurrentFee(@FieldMap Map<String, String> map, @Field("orderId") String orderId);

    /*根据车牌获取车的信息*/
    @FormUrlEncoded
    @POST("incar/v/car/car-information")
    Call<CarDetailBean> getCarMessageByLicense(@FieldMap Map<String, String> map, @Field("LicenseTag") String LicenseTag);


    //芝麻授权
    @FormUrlEncoded
    @POST("incar/v/zhima/getAuthorizeUrl")
    Call<ZhiMaShouQuanBean> getZhiMaAuthorizeUrl(@FieldMap Map<String, String> map);

    //充电桩
    @FormUrlEncoded
    @POST("incar/v/electricStation/chargingPile")
    Call<RechargeDotBean> getRechargeDot(@FieldMap Map<String, String> map);

    //检测违章
    @GET("api-oms/car-peccancy/check-isnew")
    Call<CheckPeccancyBean> checkPeccancy(@QueryMap Map<String, String> map, @Query("user_id") String user_id);

    //标记为已读
    @FormUrlEncoded
    @POST("api-oms/car-peccancy/update-isread")
    Call<CheckPeccancyBean> notifyPeccancy(@FieldMap Map<String, String> map, @Field("user_id") String user_id);

    //已开通城市列表
    @FormUrlEncoded
    @POST("incar/city/getCityList")
    Call<OpenedCityListBean> getCityList(@FieldMap Map<String, String> requestFieldMap);

    //还车备注
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("epimetheus/v1/rcc")
    Call<ReturnCarCommentBean> returnCarComment(@Body RequestBody event);

    //禁停区校验
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @GET("cs-car/car/return/valid")
    Call<ForbidArea> checkoutForbidArea(@Query("carId") String carId, @Query("areaCode") String areaCode, @Query("userId") String userId, @Query("orderNum") String orderNum);

    //还车断电
    @FormUrlEncoded
    @POST("incar/v/car/pre-return-car")
    Call<CommonResultBean> offElectricity(@FieldMap Map<String, String> map, @Field("orderId") String orderId, @Field("carId") String carId);

    //日租前续航提示
    @FormUrlEncoded
    @POST("incar/v/car/checkMileage")
    Call<CommonResultBean> checkEnduranceMileage(@FieldMap Map<String, String> map, @Field("carId") String carId, @Field("isAbatement") String isAbatement, @Field("priceType") String priceType,
                                                 @Field("rentType") String rentType, @Field("endCarTime") String endCarTime, @Field("dayNum") String dayNum);


    //日租费用预算
    @FormUrlEncoded
    @POST("incar/v/account/beforeOrderDetail")
    Call<DayRentPriceBean> getDayRentPrice(@FieldMap Map<String, String> map, @Field("carId") String carId, @Field("isAbatement") String isAbatement,
                                           @Field("priceType") String priceType, @Field("rentType") String rentType, @Field("endCarTime") String endCarTime, @Field("dayNum") String dayNum);

    @GET("goldbean/v1/get-alert")
    Call<ReturnGoldTipBean> getReturnGoldTip(@QueryMap Map<String, String> map, @Query("orderNum") String orderNum);

    //获取送车上门日租车辆的配置信息
    @Headers({"Content-Type: application/json"})
    @POST("incar/v/preOrder/abatementMoney")
    Call<AbatementMoneyBean> getAbatementMoney(@Body RequestBody event);

    //添加预订单
    @Headers({"Content-Type: application/json"})
    @POST("incar/v/preOrder/addPreOrder")
    Call<AddPreOrder> addPreOrder(@Body RequestBody event);

    //判断用户当前位置是否处于可下单围栏里
    @Headers({"Content-Type: application/json"})
    @POST()
    Call<JudgeOrderBean> judgeOrder(@Url String url, @Body RequestBody event);

    //补交驾驶证
    @Headers({"Content-Type: application/json"})
    @POST("user-terminal/v/user/uploadUserDrivingLicense")
    Call<CommitDriveLicenseBean> commitDrivingLicense(@Body RequestBody event);

    //检测车损
    @FormUrlEncoded
    @POST("tiny/parse/functions/findRecentUserReport")
    @Headers({"X-Parse-Application-Id:buYPix4muDiMmfBeJRLJexaU", "X-Parse-REST-API-Key:XReRMP8sgCnPWgJcEGxovUCM", "X-Parse-JavaScript-Key: LNEiVZYMwLpUVZiLjcpTh2gc"})
    Call<CarDamageBean> checkCarDamage(@Field("orderId") String orderId);

    //预约订单详情
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("incar/v/preOrder/preOrderDetail")
    Call<PreOrderDetailBean> preOrderDetail(@Body RequestBody body);

    //获取送车员电话
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("incar/v/preOrder/getStaffPhone")
    Call<SendTelBean> getStaffPhone(@Body RequestBody body);

    //取消预约订单
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("incar/v/preOrder/cancle")
    Call<SendTelBean> cancelPreOrder(@Body RequestBody body);

    //获取预估费用
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("incar/v/account/estimatedCost")
    Call<DeliverPriceBean> getOrderFee(@Body RequestBody body);


}




